// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false




// axios
import axios from 'axios'
axios.defaults.baseURL = "http://127.0.0.1/api/data/"
Vue.prototype.axios = axios 






// 路由
import VueRouter from 'vue-router'
import Goods from './components/Goods'
import Ratings from './components/Ratings'
import Seller from './components/Seller'
import Person from './components/Person'
import Order from './components/order'
import MyAddr from './components/myAddr'
import AddAddr from './components/AddAddr'
import SelectAddr from './components/SelectAddr'
import OrderDetailed from './components/OrderDetailed'
import GoodDetail from './components/goodDetail'
import Login from './components/login'

Vue.use(VueRouter)
const routes=[
    {path:'/',redirect:'/goods'},
    {path:'/goods',component:Goods},
    {path:'/ratings',component:Ratings},
    {path:'/seller',component:Seller},
    {path:'/person',component:Person},
    {path:'/order',component:Order,name:'order'},
    {path:'/myAddr',component:MyAddr,name:'myAddr'},
    {path:'/addAddr',component:AddAddr,name:'addAddr'},
    {path:'/selectAddr',component:SelectAddr,name:'selectAddr'},
    {path:'/orderDetailed',component:OrderDetailed,name:'orderDetailed'},
    {path:'/goodDetail',component:GoodDetail,name:'goodDetail'},
    {path:'/login',component:Login,name:'login'}
]

const router=new VueRouter({
    routes
})


// vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)

// 全局属性
Vue.prototype.api="http://shop.whmtzyyy.com/api/index.php/"
Vue.prototype.bb="http://shop.whmtzyyy.com/api/business.php"
Vue.prototype.img="http://shop.whmtzyyy.com/api/upload/"
Vue.prototype.defaultImg=""



import 'mint-ui/lib/style.css'
import MintUI from 'mint-ui'
Vue.use(MintUI)

// 过滤器
Vue.filter('imgDefault',function(value){
  // console.log(value)
  if (!value) {
    return "http://shop.whmtzyyy.com/api/upload/201812051103410.png"
  }else{
    return value
  }
})



/* eslint-disable no-new */
new Vue({
  el: '#app',
  components: { App },
  template: '<App/>',
  router
})


